<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<title>Super-TEAM游戏推荐网</title>
	{% load static %}
	<meta charset="UTF-8">
	<meta name="description" content="EndGam Gaming Magazine Template">
	<meta name="keywords" content="endGam,gGaming, magazine, html">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<!-- Favicon -->
	<link href="../static/img/logo.jpg" rel="shortcut icon"/>

	<!-- Google Font -->
	<link href="https://fonts.googleapis.com/css?family=Roboto:400,400i,500,500i,700,700i,900,900i" rel="stylesheet">

	<!-- Stylesheets -->
	<link rel="stylesheet" href="{%static 'css/bootstrap.min.css' %}"/>
	<link rel="stylesheet" href="{%static 'css/font-awesome.min.css' %}"/>
	<link rel="stylesheet" href="{%static 'css/slicknav.min.css' %}"/>
	<link rel="stylesheet" href="{%static 'css/owl.carousel.min.css' %}"/>
	<link rel="stylesheet" href="{%static 'css/magnific-popup.css' %}"/>
	<link rel="stylesheet" href="{%static 'css/animate.css' %}"/>
	<!-- Main Stylesheets -->
	<link rel="stylesheet" href="{%static 'css/style.css' %}"/>

	<!--引入弹窗swal的CSS和js-->
    <link rel="stylesheet" href="{%static 'css/sweetalert.css' %}">
    <script src="{%static 'js/sweetalert-dev.js' %}"></script>

	<script src="{%static 'js/jquery-3.4.1.js' %}"></script>
    <script src="{%static 'js/jquery.cookie.js' %}"></script>
	<script src="{% static 'js/change-info.js' %}"></script>

	<style>
		a:link { color: #eee; text-decoration: none; }/* 未访问的链接 */
		a:visited { color: #fff; text-decoration: line-through; } /* 已访问的链接 */
		a:hover { color: #fff; text-decoration: underline; }/* 鼠标移动到链接上 */
		a:active { color: #F00; } /* 选定的链接 */
		.blog-item .blog-text p{text-overflow: ellipsis;overflow: hidden;display: -webkit-box;-webkit-line-clamp: 3;-webkit-box-orient: vertical;}
		.widget-item {width: 300px;}
		.trending-widget .tw-item {height: 60px}
		input::-webkit-input-placeholder {color: #666666;font-size: 12px;}
		/*推荐视频栏高度*/
		.intro-video-section {height: 600px;}
		.hero-item h2 {font-size: 60px;font-weight: 700;line-height: 1;}
		/*右上角样式*/
		/*.user-panel {margin-top: -20px;width: 150px;}*/
		.user-panel button {background-color: #081624;color: #fff;border: none;outline: none;}
		.user-panel button:hover {color: #b01ba5;}
		.close {display: inline-block;width: 30px;height: 4px;background: #333;transform: rotate(45deg);}
		.close::after {content: '';display: block;width: 30px;height: 4px;background: #000000;transform: rotate(-90deg);}

		/*模态框样式*/
		.modal-content{background-color:#fff;border: none}
        html {font-size: 10px;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}
        .layout {width: 100%;}
        .layout：after{content: " ";display: block;height: 0;clear: both;visibility: hidden;overflow: hidden;}
        .tonav{background: #061f41;url()center no-repeat;background-size: 100% auto;}
        .tonav .pos-tl {position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);-webkit-transform: translate(-50%,-50%);-moz-transform: translate(-50%,-50%);-ms-transform: translate(-50%,-50%);}
        .tonav nav{padding-top: 20px;padding-bottom: 20px;}
        .login_in .wrap{background-color: #fff;padding: 30px;}
        .login_in .wrap .title{color: #061f41;padding: 10px 0;border-bottom: 1px solid #bfbfbf;position: relative;font-size: 2.5rem;}
        .login_in .wrap .title:after{content: "";bottom: 0;left: 0;width: 150px;height: 2px;background-color: #061f41;}
        .login_in .wrap .title span{display: inline-block;width: 150px;text-align: center;}
        .login_in .wrap .item{width: 305px;height: 41px;margin: 1px 0 15px 0;background-color: #FFF;border: 1px solid #BFBFBF;}
        .login_in .wrap .item .ico{font-size: 1.6rem;color: #BFBFBF;padding: 0 8px;}
        .login_in .wrap input[type="text"], .login_in .wrap input[type="password"]{font-size: 1.4rem;border: none;width: 263px;height: 38px;background-color: #FFF;outline: none;}
        .login_in .wrap .item-submit{text-align: center;}
        .login_in .wrap input[type="submit"]{border: none;color: #fff;background-color: #061f41;padding: 10px 0;font-size: 1.8rem;width: 305px;}
        .login_in .wrap .dl_zidong{text-align: right;margin-bottom: 20px;vertical-align: middle;}
        .login_in .wrap .dl_zidong input {width: 16px;height: 16px;vertical-align: middle;}
        .login_in .wrap .dl_zidong span{vertical-align: middle;}
        .login_in .wrap .dl_title{display: flex;justify-content: space-between;padding-top: 10px;}
        .login_in .wrap .dl_if{color: #0b0b0b;cursor: pointer;}
        .login_in .wrap .dl_forget{color: #adb5bd;cursor: pointer;}

	</style>
</head>


<body>
	<!-- Page Preloder -->
	<div id="preloder">
		<div class="loader"></div>
	</div>

	<!-- Header section -->
	<header class="header-section">
		<div class="header-warp">
			<div class="header-bar-warp d-flex">
				<!-- site logo -->
				<a href="/" class="site-logo">
					<img src="../static/img/Logo-ST.png" height="29.5" alt="">
				</a>
				<nav class="top-nav-area w-100">
					{% if isLogin == False %}
					<div class="user-panel" style="display: block" id="login_register">
						<button data-toggle="modal" data-target="#login" data-backdrop="static">登录</button> /
						<button data-toggle="modal" data-target="#register" data-backdrop="static">注册</button>
					</div>
					<!--登录后ajax不刷新显示登录信息-->
<!--					<div class="user-panel" style="display: none" id="user_welcome">-->
<!--						<p style="color: gold"></p>-->
<!--						<button data-toggle="modal" data-target="#profile" data-backdrop="static">个人信息</button> /-->
<!--						<button onclick="window.location.href='/logout'">退出</button>-->
<!--					</div>-->
					{% else %}
					<!--刷新后通过session获取登录信息-->
					<div class="user-panel" style="margin-top: -20px">
						<p style="color: gold">欢迎您，{{name}}!</p>
						<button data-toggle="modal" data-target="#profile" data-backdrop="static" style="margin-left: -6px">个人信息</button> /
						<button onclick="window.location.href='/logout'">退出</button>
					</div>
					{% endif %}
					<!-- Menu -->
					<ul class="main-menu primary-menu">
						<li><a href="/">首页</a></li>
						<li><a href="/discover">发现</a></li>
						<li><a href="/ranklist">排行榜</a></li>
						<li><a href="/about">关于我们</a></li>
					</ul>
				</nav>
			</div>
		</div>
	</header>
	<!-- Header section end -->

	<!-- Hero section -->
	<section class="hero-section overflow-hidden">
		<div class="hero-slider owl-carousel">
			{% for game in game_hero %}
			<div class="hero-item set-bg d-flex align-items-center justify-content-center text-center" data-setbg="/static/img/slider-bg-1.jpg">
				<div class="container">
					<h2>{{game.name}}！</h2>
					<p><br>{{game.describe}}</p>
					<a href="/gameSingle?id={{game.gameid}}" class="site-btn" style="color: black">了解更多<img src="/static/img/icons/double-arrow.png" alt="#"/></a>
				</div>
			</div>
			{% endfor %}
		</div>
	</section>
	<!-- Hero section end-->


	<!-- Blog section -->
	<section class="blog-section spad">
		<div class="container">
			<div class="row">

				<div class="col-xl-9 col-lg-8 col-md-7">
					<div class="section-title text-white">
						<h2>所有游戏</h2>
					</div>
					<ul class="blog-filter">
						{% for gametag in gametags %}
						<li><a href="/discover/?tag={{gametag.tag}}">{{gametag.tag}}</a></li>
						{% endfor%}
					</ul>

					<!-- Blog item -->
					{% for gamerecommend in gamerecommends %}
					<div class="blog-item">
						<div class="blog-thumb">
							<a href="/gameSingle/?id={{gamerecommend.gameid}}">
								<img src={{gamerecommend.picture}} alt="#">
							</a>
						</div>
						<div class="blog-text text-box text-white" >
							<h3 style="margin: 0 0 10px">
								<a style="font-size:25px" href="/gameSingle/?id={{gamerecommend.gameid}}" class="read-more">{{gamerecommend.name}}</a>
							</h3>
							<p style="color: #f2dede;margin: 0 0 10px">{{gamerecommend.describe}}</p>
							<a href="/gameSingle/?id={{gamerecommend.gameid}}" class="read-more">Read More
								<img src="/static/img/icons/double-arrow.png" alt="#"/>
							</a>
						</div>
					</div>
					{% endfor %}
				</div>

				<div class="col-xl-3 col-lg-4 col-md-5 sidebar" style="position:absolute;right:0px;">
					<div id="stickySidebar">
						<div class="widget-item">
							<div class="categories-widget">
								<h4 class="widget-title">热门游戏</h4>
								<ul>
									<div class="trending-widget">
										{% for game in games2 %}
										<div class="tw-item">
											<div class="tw-thumb">
												<a href="/gameSingle/?id={{game.gameid}}">
													<img src={{game.picture}} alt="游戏图片" style="width: 100px">
												</a>
											</div>
											<div class="tw-text">
												<h5 style=" overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">
													<a href="/gameSingle/?id={{game.gameid}}">{{game.name}}</a>
												</h5>
												<br/>
											</div>
										</div>
										{% endfor %}
										<div class="tw-text">
											<h5><a href="/ranklist" >更多游戏······</a></h5>
										</div>
									</div>
								</ul>
							</div>
						</div>
					</div>
				</div>

			</div>
		</div>
	</section>
	<!-- Blog section end -->


    <!-- Intro section -->
	{% for game in games1 %}
	{% if forloop.first %}
	<section class="intro-video-section set-bg d-flex align-items-end" data-setbg={{game.picture}}>
		<a href="https://www.bilibili.com/video/BV1mi4y1b76M/" class="video-play-btn video-popup"><img src="/static/img/icons/solid-right-arrow.png" alt="#"></a>
		<div class="container">
			<div class="video-text">
				<h2 style="color: #000000">观看游戏视频</h2>
				<p style="color: #0b0b0b">这是一个推荐的游戏视频，点击观看吧！</p>
			</div>
		</div>
	</section>
	{% endif %}
	{% endfor %}
	<!-- Intro section end -->


	<!-- Footer section -->
	<footer class="footer-section">
		<div class="container">
			<div class="footer-left-pic">
				<img src="/static/img/footer-left-pic.png" alt="">
			</div>
			<div class="footer-right-pic">
				<img src="/static/img/footer-right-pic.png" alt="">
			</div>
			<a href="#" class="footer-logo">
				<img src="/static/img/Logo-ST.png" width="500px"  alt="">
			</a>
			<ul class="main-menu footer-menu">
                <li><a href="/">首页</a></li>
				<li><a href="/discover">发现</a></li>
				<li><a href="/ranklist">排行榜</a></li>
				<li><a href="/about">关于我们</a></li>
			</ul>
			<div class="footer-social d-flex justify-content-center">
				<a href="#"><i class="fa fa-weixin"></i></a>
				<a href="#"><i class="fa fa-qq"></i></a>
			</div>
			<div class="copyright"><a href="">Super-TEAM</a> 2022 @ All rights reserved</div>
		</div>
	</footer>
	<!-- Footer section end -->

	<!--====== Javascripts & Jquery ======-->
	<script src="{% static 'js/jquery-3.2.1.min.js' %}"></script>
	<script src="{% static 'js/bootstrap.min.js' %}"></script>
	<script src="{% static 'js/jquery.slicknav.min.js' %}"></script>
	<script src="{% static 'js/owl.carousel.min.js' %}"></script>
	<script src="{% static 'js/jquery.sticky-sidebar.min.js' %}"></script>
	<script src="{% static 'js/jquery.magnific-popup.min.js' %}"></script>
	<script src="{% static 'js/main.js' %}"></script>


	<!--弹出登录窗口-->
	<div id="login" class="modal fade">
		<div class="modal-dialog">
			<div class="modal-content">

				<div class="layout tonav pos-r">
        			<div class="login_in pos-tl">
        			    <div class="wrap">
							<div class="modal-body">
								<span class="close" data-dismiss="modal"></span>
							</div>
        			        <center><p class="pd-bottom title">登录系统</p></center>
							<form class="form-group" >
<!--								{%csrf_token%}   &lt;!&ndash;csrf验证&ndash;&gt;-->
								<div class="item">
									<span class="ico i-user"></span>
									<input type="text" name="phone" id="phone_login"  value="{{phone}}" placeholder="请输入手机号码" required="required" minlength="11" oninput="if(value.length>11)value=value.slice(0,11)">
								</div>
								<div class="item">
									<span class="ico i-unlock-alt"></span>
									<input type="password" name="password" id="password_login" value="{{password}}" placeholder="请输入登录密码" required="required" />
									<span class="glyphicon glyphicon-eye-open" onclick="change(document.getElementById('password_login'))">⊙</span>
								</div><br/>
								<div class="item-submit">
									<input class="btn btn-primary" type="button" onclick="login_form()" value="登 录" style="font-size: 15px;width: 80px;"/>
								</div>
								<br/>
								<div class="dl_title">
									<a data-toggle="modal" data-target="#register" data-backdrop="static" class="dl_if">注册新用户</a>
									<a data-toggle="modal" data-target="#forget" data-backdrop="static" class="dl_forget">忘记密码？</a>
								</div>
							</form>
        			    </div>
        			</div>
   	 			</div>

			</div>
		</div>
	</div>
	<!--登录窗口结束-->


	<!--弹出注册窗口-->
	<div id="register" class="modal fade">
		<div class="modal-dialog" >
			<div class="modal-content">

				<div class="layout tonav pos-r">
					<div class="login_in pos-tl">
						<div class="wrap">
							<div class="modal-body">
								<span class="close" data-dismiss="modal"></span>
							</div>
							<center><p class="pd-bottom title"><span>注册系统</span></p></center>

							<form class="form-group" >
<!--								{%csrf_token%}-->
								<div class="item">
									<span class="ico i-user"></span>
									<input type="text" id="name_register" placeholder="请输入用户名" required="required">
								</div>
								<div class="item">
									<span class="ico i-user"></span>
									<input type="text" id="phone_register" placeholder="请输入手机号码" required="required" minlength="11" oninput="if(value.length>11)value=value.slice(0,11)" onblur="checkphone()">
								</div>
								<div class="item">
									<span class="ico i-user"></span>
									<input type="text" id="age_register" placeholder="请输入年龄" required="required">
								</div>
								<div>
									<span style="display:inline-block;font-size: medium;color: black">请选择性别：</span>
									<select name="gender" id="gender_register" style="width:80px;height:28px">
										<option value="1">男</option>
										<option value="2">女</option>
									</select>
								</div><br/>
								<div>
									<span style="display:inline-block;font-size: medium;">请选择职业：</span>
									<select name="profession" id="profession_register" style="width:80px;height:28px">
										<option value="1">学生</option>
										<option value="2">老师</option>
										<option value="3">程序员</option>
										<option value="4">项目经理</option>
										<option value="5">其他</option>
									</select>
								</div><br/>
								<div class="item">
									<span class="ico i-unlock-alt"></span>
									<input type="password" name="password" id="password1_register" placeholder="请输入密码" required="required">
									<span class="glyphicon glyphicon-eye-open" onclick="change(document.getElementById('password1_register'))">⊙</span>
								</div>
								<div class="item">
									<span class="ico i-unlock-alt"></span>
									<input type="password" name="password" id="password2_register" placeholder="再次输入密码" required="required">
									<span class="glyphicon glyphicon-eye-open" onclick="change(document.getElementById('password2_register'))">⊙</span>
								</div><br/>
								<div class="item-submit">
									<input class="btn btn-primary" type="button" onclick="register_form()" value="注 册" style="font-size: 15px;width: 80px;"/>
								</div>
							</form>

						</div>
					</div>
				</div>

			</div>
		</div>
	</div>
	<!--注册窗口结束-->


    <!--忘记密码窗口-->
	<div id="forget" class="modal fade">
		<div class="modal-dialog">
			<div class="modal-content">

				<div class="layout tonav pos-r">
					<div class="login_in pos-tl">
						<div class="wrap">
							<div class="modal-body">
								<span class="close" data-dismiss="modal"></span>
							</div>
							<center><p class="pd-bottom title">忘记密码</p></center>
							<form class="form-group" >
<!--								{%csrf_token%}   &lt;!&ndash;csrf验证&ndash;&gt;-->
								<div class="item">
									<span class="ico i-user"></span>
									<input type="text" name="phone" id="phone_forget" value="" placeholder="请输入手机号码" required="required" minlength="11" oninput="if(value.length>11)value=value.slice(0,11)">
								</div>
								<div class="item">
									<span class="ico i-unlock-alt"></span>
									<input type="password" name="password" id="password_forget" value="" placeholder="请输入密码" required="required" />
									<span class="glyphicon glyphicon-eye-open" onclick="change(document.getElementById('password_forget'))">⊙</span>
								</div><br/>
								<div class="item-submit">
									<input class="btn btn-primary" type="button" onclick="forget_form()" value="修  改" style="font-size: 15px;width: 80px;"/>
								</div>
							</form>
						</div>
					</div>
				</div>

			</div>
		</div>
	</div>
	<!--忘记密码窗口结束-->


	<!--个人信息窗口-->
	<div id="profile" class="modal fade">
		<div class="modal-dialog" >
			<div class="modal-content">

				<div class="layout tonav pos-r">
					<div class="login_in pos-tl">
						<div class="wrap">
							<div class="modal-body">
								<span class="close" data-dismiss="modal"></span>
							</div>
							{% if isLogin == True %}
							<center><p class="pd-bottom title"><span>修改个人信息</span></p></center>
							<form class="form-group" >
<!--								{%csrf_token%}-->
								用户名：
								<div class="item">
									<span class="ico i-user"></span>
									<input type="text" id="name_change" value={{name}}>
								</div>
								手机号：
								<div class="item">
									<span class="ico i-user"></span>
									<input type="text" id="phone_change" value={{phone}} readonly>
								</div>
								年龄：
								<div class="item">
									<span class="ico i-user"></span>
									<input type="text" id="age_change" value={{age}}>
								</div>
								<div>
									<span style="display:inline-block;color: black">性别：</span>
									<select name="gender" id="gender_change" style="width:80px;height:30px">
										{% if gender == '男' %}
										<option value="1" selected>男</option>
										<option value="2">女</option>
										{% else %}
										<option value="1">男</option>
										<option value="2" selected>女</option>
										{% endif %}
									</select>
									<span style="display:inline-block;">职业：</span>
									<select name="profession" id="profession_change" style="width:80px;height:30px">
										<option value="1">学生</option>
										<option value="2">老师</option>
										<option value="3">程序员</option>
										<option value="4">项目经理</option>
										<option value="5">其他</option>
									</select>

								</div><br/>
								密码：
								<div class="item">
									<span class="ico i-unlock-alt"></span>
									<input type="password" id="password_change" name="password" value={{password}}>
									<span class="glyphicon glyphicon-eye-open" onclick="change(document.getElementById('password_change'))">⊙</span>
								</div><br/>
								<div class="item-submit">
<!--									<button class="btn btn-primary" onclick="profile_form()" style="font-size: 15px;width: 80px;">修  改</button>-->
									<input class="btn btn-primary" type="button" value="修 改" onclick="profile_form()" style="font-size: 15px;width: 80px;"/>
								</div>
							</form>
<!--							{% else %}-->
<!--							<span class="pd-bottom title" style="vertical-align:middle;"><br/>请刷新一下^__^</span>-->
							{% endif %}
						</div>
					</div>
				</div>

			</div>
		</div>
	</div>
	<!--个人信息窗口结束-->


	<script>
		//将模态框定位到屏幕正中间
		$('#login').on('shown.bs.modal', function (e) {
			// 关键代码，如没将modal设置为 block，则$modala_dialog.height() 为零
			$(this).css('display', 'block');
			var modalHeight = $(window).height() / 2 - $('#login .modal-dialog').height() / 2;
			$(this).find('.modal-dialog').css({
				'margin-top': modalHeight
			});
		});

		$('#register').on('shown.bs.modal', function (e) {
            // 关键代码，如没将modal设置为 block，则$modala_dialog.height() 为零
            $(this).css('display', 'block');
            var modalHeight=$(window).height() / 2 - $('#register .modal-dialog').height() / 2;
            $(this).find('.modal-dialog').css({
                'margin-top': modalHeight
            });
        });

		$('#forget').on('shown.bs.modal', function (e) {
			// 关键代码，如没将modal设置为 block，则$modala_dialog.height() 为零
			$(this).css('display', 'block');
			var modalHeight = $(window).height() / 2 - $('#forget .modal-dialog').height() / 2;
			$(this).find('.modal-dialog').css({
				'margin-top': modalHeight
			});
		});

		$('#profile').on('shown.bs.modal', function (e) {
			// 关键代码，如没将modal设置为 block，则$modala_dialog.height() 为零
			$(this).css('display', 'block');
			var modalHeight = $(window).height() / 2 - $('#profile .modal-dialog').height() / 2;
			$(this).find('.modal-dialog').css({
				'margin-top': modalHeight
			});
		});

	</script>

	</body>
</html>
